package ccrClasses.layer2;

import ccrClasses.ICcr;

public class NormalResult implements ICcr {
	
	//@TODO mudar esta classe;
	//O serviço em si não aceita essa sintaxe, embora esteja no site
	//A sintaxe é a seguinte
	//<NormalResult>
	//	<Normal>
	//    <Description>
	//      <Text>...</Text>
	//    </Description>
	//  </Normal>
	//</NormalResult>
	
	public static final String OPEN_TAG = "<NormalResult>";

	public static final String CLOSE_TAG = "</NormalResult>";
	
	@Deprecated
	private Value value;
	
	@Deprecated
	private Units units;
	
	private Normal normal;

	public NormalResult(){
		super();
	}
	
	public NormalResult(Normal normal){
		this.normal = normal;
	}
	
	@Deprecated
	public NormalResult(Value value, Units units) {
		super();
		this.setValue(value);
		this.setUnits(units);
	}
	
	@Deprecated
	public NormalResult(Value value) {
		super();
		this.setValue(value);
	}
	
	@Deprecated
	public NormalResult(Units units) {
		super();
		this.setUnits(units);
	}


	@Override
	public String constructCcrString() {
		String ccrNormalResult = OPEN_TAG;
		if(value != null){
			ccrNormalResult += value.constructCcrString();
		}
		
		if(units != null){
			ccrNormalResult += units.constructCcrString();
		}
		
		if(normal != null){
			ccrNormalResult += normal.constructCcrString();
		}
		
		ccrNormalResult += CLOSE_TAG;
		return ccrNormalResult;
	}


	/**
	 * @param value the value to set
	 */
	public void setValue(Value value) {
		this.value = value;
	}


	/**
	 * @return the value
	 */
	public Value getValue() {
		return value;
	}


	/**
	 * @param units the units to set
	 */
	public void setUnits(Units units) {
		this.units = units;
	}


	/**
	 * @return the units
	 */
	public Units getUnits() {
		return units;
	}

	/**
	 * @param normal the normal to set
	 */
	public void setNormal(Normal normal) {
		this.normal = normal;
	}

	/**
	 * @return the normal
	 */
	public Normal getNormal() {
		return normal;
	}

}
